<?php
namespace app\index\controller;
use think\Controller;
use think\Db;

class Index extends Controller
{
    public $callback;
    //返回index页面数据
    public function index()
    {

      $this->callback=$_GET['callback'];
    	$sql = "select * from product";
    	$arr = Db::table('product')->limit(0,4)->select();
        foreach($arr as $k=>$v){
            $arr[$k]['interestRate'] = $v['interestRate']*100;
        }
    	$data['data'] = $arr;
    	$data['msg'] = '200';
    	$json = json_encode($data);
        echo $_GET['callback']."(".$json.")";
    }
 
}